Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add COLNAMES option to give names to the columns #11

Merged
merged 2 commits into from
Jan 21, 2023

Conversation

roblabla
Copy link
Contributor

@roblabla roblabla commented Jan 6, 2023

The COLNAMES option should contain the row number giving the name to the columns. This name will be used in place of the lettered column name used by excel in the SQL Table.

Copy link
Owner

@x2bool x2bool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 minor comments from me. Otherwise looks good! 😊

@@ -49,6 +51,16 @@ fn parse_range_option(input: &str) -> IResult<&str, UsingOption> {
|t: (&str, &str)| UsingOption::Range(t.1.to_string()))(input)
}

fn parse_colnames_option(input: &str) -> IResult<&str, UsingOption> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a test for this option? Very basic and simple. This would also document what is considered as allowed input for this option.

Also adding example to README.md would be nice, but I could do this myself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some tests. I tried to add to the readme too, but I wasn't sure how to do explain it clearly.

The COLNAMES option should contain the row number giving the name to the
columns. This name will be used in place of the lettered column name
used by excel in the SQL Table.
@roblabla
Copy link
Contributor Author

roblabla commented Jan 8, 2023

While adding the tests, I fixed COLNAMES using 0-based indexing instead of 1-indexing, which made its usage next to the RANGE keyword very weird. See https://github.com/x2bool/xlite/pull/11/files#diff-6fad74dbaa3be1cb394546cf648fb13695503f28e12e6f06fb3406b922e5a246R106

@x2bool
Copy link
Owner

x2bool commented Jan 21, 2023

Good feature! Thank you for your work 😊

@x2bool x2bool merged commit da7d34e into x2bool:master Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants